import '@/styles/index.scss'

import Vue from 'vue'

import ElementUI from 'element-ui'
import ElResetTabs from './el-reset/tabs'
import VueCompositionAPI from '@vue/composition-api'
import ECharts from 'vue-echarts'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { BarChart, GaugeChart, ScatterChart, PieChart, LineChart } from 'echarts/charts'
import {
  GridComponent,
  TitleComponent,
  TooltipComponent,
  MarkLineComponent,
  LegendComponent,
  ToolboxComponent
} from 'echarts/components'

import App from './App'
import store from './store'
import router from './router'
import './components/install' // 组件全局注册
import './directives/install' // 自定义指令
import './filters/install' // 自定义过滤器
import './permission' // 页面权限控制

import './icons' // icon

// 修改 el-dialog 默认点击遮照为不关闭
ElementUI.Dialog.props.closeOnClickModal.default = false
ElementUI.Dialog.props.closeOnPressEscape.default = false
Vue.use(ElementUI, {
  size: 'small',
  zIndex: 2000
})
Vue.use(ElResetTabs)
Vue.use(VueCompositionAPI)
Vue.component('v-chart', ECharts)
use([
  CanvasRenderer,
  BarChart,
  GaugeChart,
  ScatterChart,
  PieChart,
  LineChart,
  GridComponent,
  TitleComponent,
  TooltipComponent,
  MarkLineComponent,
  LegendComponent,
  ToolboxComponent
])

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: (h) => h(App)
})
